#!/bin/bash
# ros install

sudo apt install python-pip

sudo pip install rosdep wstool rosinstall_generator


sudo sh -c 'echo "[global]
index-url=https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host=pypi.tuna.tsinghua.edu.cn" >> ~/.pip/pip.conf'

sudo cp ./base-openeuler.yaml /etc/ros/rosdep/base-openeuler.yaml
sudo sh -c 'echo "yaml file:///etc/ros/rosdep/base-openeuler.yaml" >> /etc/ros/rosdep/sources.list.d/10-openeuler.list'


sudo sh -c 'echo "151.101.76.133	raw.githubusercontent.com" >> /etc/hosts'

sudo rosdep init
rosdep update

mkdir debian10
cd debian10

rosinstall_generator desktop_full --rosdistro melodic --deps --tar > melodic-desktop-full.rosinstall
wstool init -j8 src melodic-desktop-full.rosinstall
rosdep install --from-paths src --ignore-src --rosdistro melodic -y -r

./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release -DCATKIN_ENABLE_TESTING=0 --ignore-pkg rviz librviz_tutorial rqt_rviz rviz_plugin_tutorials rviz_python_tutorial gazebo_ros gazebo_plugins gazebo_ros_control qt_gui_cpp rqt_gui_cpp rqt_image_view pcl_ros -j1

echo "source ~/ros/fedora29roscartographer/installation_ros/install_isolated/setup.bash" >> ~/.bashrc



